{include file="common/head"}
<body>
	{include file="common/menu"}
		<div class="blog">
				<div class="container">
					<div class="blog-left">
						<div class="blog-left-head">
							<span> </span>
							<h1>评论专区</h1>
						</div>
						<!---start-blog-single-page---->
						<div class="blog-single-page">
							<h3><a href="#">您的评论就是对我们最好的建议</a></h3>
							<div class="clearfix"> </div>
							<div class="blog-single-page-artical-comment-section">
								<div class="comment-secion-head">
									<span> </span>
									<h2>总评论数<label>({$count_comment | default=0})</label></h2>
								</div>
								{foreach($comment1 as $k => $v)}
								<div class="artical-comment-grid">
									<div class="artical-comment-grid-left">
										<a href="#"><img src="/index/img/03.jpg" alt=""></a>
									</div>
									<div class="artical-comment-grid-info">
										<ul>
											<li class="p-name"><a href="">{$v.user_name}</a></li>
											<li>{$v.created_ts | date='Y-m-d H:i:s',###} </li>
										</ul>
										<p>{$v.comment} </p>
									</div>
									<div class="clearfix"> </div>
								</div>
								{/foreach}
								<div class="comment-secion-head">
									<span> </span>
									<h2>发布评论</h2>
								</div>
								<div class="leave-comment">
									<div class="table-form">
											<div>
												<label>您的评论<span>*</span></label>
												<textarea id="text"></textarea>
											</div>
										<input type="submit" value="提交" id="sub">
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="clearfix"> </div>
				</div>
			</div>
	{include file="common/foot"}
	</body>
</html>
<script>
	$('#sub').click(function () {
		var text = $('#text').val();
        $.ajax({
            type: "POST",
            dataType: 'json',
            url: '/index/index/addContact',
            data:{
                comment:text,
            },
            success: function (data) {
                if (data.code == 200) {
                    layer.msg(data.msg);
                    window.location.reload();
                }else{
                    layer.msg(data.msg);
                }
            }
        });
    });

</script>
